#pragma once
#include "Socket.hpp"

#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>

#include <string>
#include <iostream>
#include <memory>

template <class T>
class Client
{
public:
    Client(std::string &ip, in_port_t port, T task)
        : _client_usage(std::make_shared<ClientSocket>(ip, port)), _task(task)
    {
        _client_usage->ClientInit();
    }

    void Running()
    {
        _task(_client_usage.get());
    }

private:
    std::shared_ptr<Socket> _client_usage;
    T _task;
};